const isKugouMiniApp = /KugouMiniApp/.test(window.navigator.userAgent)

const getQueryVariable = (variable) => {
  let query = window.location.search.substring(1);
  let vars = query.split("&");
  for (let i = 0; i < vars.length; i++) {
    let pair = vars[i].split("=");
    if (pair[0] == variable) {
      return decodeURIComponent(pair[1]);
    }
  }
  return false;
}

const convertImgUrl = (url) => {
  let URL = new String(url);
  return URL.replace(/\{size\}/, 100)
}


export {
  isKugouMiniApp,
  getQueryVariable,
  convertImgUrl
}


